fix(ui): make punctuation hotkeys layout-independent#9174
Conversation
Code reviewOverview. The core mechanism is sound — react-hotkeys-hook 4.5.0 matches the new tokens ( Findings (most severe first)
Verified non-issues
Suggested direction: apply the glyph→token mapping only when 🤖 Generated with Claude Code |
|
Addressed review feedback by separating physical-key recording from stored glyph normalization. Punctuation glyphs are no longer rewritten to physical key tokens unless KeyboardEvent.code identifies the physical key, preventing AltGr/non-US custom bindings from being retargeted. Custom hotkeys are no longer canonicalized on read; persisted hotkeys now migrate through hotkeys slice v2. Conflict detection now expands legacy glyph aliases, including shifted punctuation glyphs, without mutating saved user bindings. Physical punctuation display/search can use navigator.keyboard.getLayoutMap() when available. I thought i posted reply yesterday, but apparently i did not. |
Summary
Fix punctuation-based hotkeys in invokeai/frontend/web so they use layout-independent physical key identifiers instead of layout-dependent characters. This keeps canvas tool width shortcuts and related punctuation bindings working when a non-English keyboard layout is active. The change centralizes hotkey normalization and display formatting, canonicalizes legacy persisted bindings, and adds focused test coverage.
Also stabilize a flaky timeout assertion in invokeai/frontend/web/src/features/ui/layouts/navigation-api.test.ts so the required frontend build passes reliably under full-suite load.
Related Issues / Discussions
N/A
QA Instructions
Merge Plan
None.
Checklist
What's Newcopy (if doing a release after this PR)